
import JSEncrypt from 'jsencrypt'
 
const publicKey = `-----BEGIN RSA PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsqeIXJ7ufvyEmIdENoVn
pM5UxCJ9VNWVKBE/73lcl3Qqzh7lS5eAHIWdCmCVUYOZX1luXlM8VxyH1EyNrmlf
+/ENEAr1fBhYc5BfW9QmoEVltis7nZUD8wlfC8i5pADB/QhPpmEJHPUe8gsuwEq+
9tgxH3AurjaJuYWSeWpdtKpToK/NbmzE1aQ121LwIfIDjUW7Zegg5L2dAbL0eA8P
uC6cIp/Fe3ec+W9Hwbx3rko3Oo69Lg26xktlgiD9U32GXAFh9XI31KcjpZauyZEw
nP/xuSjjsCybAy+Ho1dChTL6Zz3OeMnvsr2Yx2NCyw4OVZWFXgRfn6A/qr00lDdF
HwIDAQAB
-----END RSA PUBLIC KEY-----` // 加密公钥
 
 
// 加密
export const encrypt = (text: string) => {
  const encryptor = new JSEncrypt()
  encryptor.setPublicKey(publicKey)
  return encryptor.encrypt(text)
}